/*   1:    */ package com.rinsi.admin.stamp;
/*   2:    */ 
/*   3:    */ import com.rinsi.core.contoller.CoreSimpleController;
/*   4:    */ import com.rinsi.core.service.CoreSimpleService;
/*   5:    */ import com.rinsi.util.MapUtil;
/*   6:    */ import java.io.IOException;
/*   7:    */ import java.io.PrintWriter;
/*   8:    */ import java.util.Map;
/*   9:    */ import javax.servlet.ServletOutputStream;
/*  10:    */ import javax.servlet.http.HttpServletRequest;
/*  11:    */ import javax.servlet.http.HttpServletResponse;
/*  12:    */ import org.springframework.beans.factory.annotation.Autowired;
/*  13:    */ import org.springframework.stereotype.Controller;
/*  14:    */ import org.springframework.ui.ModelMap;
/*  15:    */ import org.springframework.web.bind.annotation.RequestMapping;
/*  16:    */ import org.springframework.web.bind.annotation.RequestParam;
/*  17:    */ import org.springframework.web.multipart.MultipartFile;
/*  18:    */ 
/*  19:    */ @Controller
/*  20:    */ @RequestMapping({"/admin/stamp"})
/*  21:    */ public class StampController
/*  22:    */   extends CoreSimpleController
/*  23:    */ {
/*  24:    */   @Autowired
/*  25:    */   private StampService stampService;
/*  26:    */   
/*  27:    */   @RequestMapping({"/upload"})
/*  28:    */   public void upload(@RequestParam MultipartFile file, HttpServletRequest request, HttpServletResponse response)
/*  29:    */   {
/*  30:    */     try
/*  31:    */     {
/*  32: 36 */       this.stampService.updateStamp(request.getParameter("ID"), file.getBytes(), request.getParameter("tempVal"));
/*  33:    */       
/*  34: 38 */       response.setCharacterEncoding("UTF-8");
/*  35:    */       
/*  36: 40 */       response.getWriter().print(file.getOriginalFilename());
/*  37:    */     }
/*  38:    */     catch (Exception e)
/*  39:    */     {
/*  40: 44 */       e.printStackTrace();
/*  41:    */     }
/*  42:    */   }
/*  43:    */   
/*  44:    */   @RequestMapping({"/changePWD"})
/*  45:    */   public Map<String, Object> changePWD(ModelMap model, HttpServletRequest request)
/*  46:    */   {
/*  47:    */     try
/*  48:    */     {
/*  49: 54 */       model.putAll(this.stampService.changePWD(model));
/*  50:    */     }
/*  51:    */     catch (Exception e)
/*  52:    */     {
/*  53: 58 */       e.printStackTrace();
/*  54:    */     }
/*  55: 61 */     return model;
/*  56:    */   }
/*  57:    */   
/*  58:    */   @RequestMapping({"/changePWDPage"})
/*  59:    */   public Map<String, Object> changePWDPage(ModelMap model, HttpServletRequest request)
/*  60:    */   {
/*  61:    */     try
/*  62:    */     {
/*  63: 70 */       model.putAll(this.stampService.getParams(model));
/*  64:    */     }
/*  65:    */     catch (Exception e)
/*  66:    */     {
/*  67: 74 */       e.printStackTrace();
/*  68:    */     }
/*  69: 77 */     return model;
/*  70:    */   }
/*  71:    */   
/*  72:    */   @RequestMapping({"/getImage"})
/*  73:    */   protected void getImage(ModelMap model, HttpServletRequest request, HttpServletResponse response)
/*  74:    */   {
/*  75:    */     try
/*  76:    */     {
/*  77: 89 */       Map<String, Object> data = this.stampService.item(model);
/*  78:    */       
/*  79: 91 */       response.setContentType("image/JPEG;charset=UTF-8");
/*  80:    */       
/*  81: 93 */       response.setContentType("application/x-msdownload;");
/*  82:    */       
/*  83: 95 */       response.getOutputStream().write((byte[])MapUtil.getMapData(data, "data").get("ORGAN_STAMP"));
/*  84:    */     }
/*  85:    */     catch (IOException e)
/*  86:    */     {
/*  87: 99 */       e.printStackTrace();
/*  88:    */     }
/*  89:    */   }
/*  90:    */   
/*  91:    */   public CoreSimpleService servce()
/*  92:    */   {
/*  93:107 */     return this.stampService;
/*  94:    */   }
/*  95:    */ }


/* Location:           D:\Users\Desktop\shanxi\项目\sxazmis\WEB-INF\classes\
 * Qualified Name:     com.rinsi.admin.stamp.StampController
 * JD-Core Version:    0.7.0.1
 */